﻿using ComputationalCore.Helper;

namespace BehaviorModel.Block.RandomGenerator
{
    /// <summary>
    /// Random generator with uniform strategy.
    /// </summary>
    public class UniformRandomGenerator : IRandomGenerator
    {
        public double Left { get; set; }
        public double Right { get; set; }

        public UniformRandomGenerator()
        {
            Left = 0;
            Right = 1;
        }

        public UniformRandomGenerator(double left, double right)
        {
            Left = left;
            Right = right;
        }

        #region Get Next

        public double GetNext(double prev)
        {
            var next = RandomHelper.NextDouble(Left, Right);
            return next + prev;
        }

        public double GetNext()
        {
            var next = RandomHelper.NextDouble(Left, Right);
            return next;
        }

        #endregion
    }
}
